package com.joker.demo.admin.router.impl;


import com.joker.demo.admin.router.ExecutorRouter;

import java.util.List;
import java.util.Random;

/**
* 
* @author : feixiang.li
* @since : 2025-07-29 17:27
*/
public class RandomExecutorRouter implements ExecutorRouter {

    // 随机
    private static final Random random = new Random();
    
    @Override
    public String route(String jobId, List<String> addressList) {
        if (addressList == null || addressList.isEmpty()) {
            return null;
        }
        int index = random.nextInt(addressList.size());
        return addressList.get(index);
    }
}
